#pragma once

#include <QtWidgets/QDockWidget>
#include "TmsMap/TmsMapTool.h"

#include "GeneratedFiles/ui_zoom_dock_title_widget.h"

class FstMainMap;

class zoom_dock_widget : public QDockWidget
{
    Q_OBJECT
public:
    zoom_dock_widget(QWidget *parent = nullptr);
    ~zoom_dock_widget();

    void SetMainMap(FstMainMap *mainMap);

public slots:
    void SetZoomRect(const MST_MAP_TOOL::Lnglat&start, const MST_MAP_TOOL::Lnglat&end);
    void SetZoomType();

protected:
    void paintEvent(QPaintEvent *event);

private:
    void setBound(QPointF &point, int max_x, int max_y);

    void init();
private:
    FstMainMap *m_main_map;

    QTimer *m_update_timer;

    MST_MAP_TOOL::Lnglat start_location_;
    MST_MAP_TOOL::Lnglat end_location_;

    QPointF start_location_pos_;
    QPointF end_location_pos_;

    bool m_is_point_type;

    QWidget *m_titilebar_widget;

    Ui::ZoomTitleBarWidget ui;
};